package com.zt.weibo.utils;

import android.util.Log;

/**
 * 该类用于打印信息
 * @author zhaotong
 */
public class PrintLog {

	private static boolean 	debug 	= true;

	private static final String	DEBUG	= "WEIBO";

	public static void PrintSetAble(boolean bAble)
	{
		debug = bAble;
	}

	/**
	 * 将msg加上文件名、行号一起打印，Tag是WEIBO。
	 * @param msg
	 */
	public static void debug(String msg)
	{
		if (debug)
		{
			StackTraceElement line = new Throwable().getStackTrace()[1];

			if (line != null)
			{
				Log.d(DEBUG, "File[" + line.getFileName() + "]Line["
						+ line.getLineNumber() + "]Msg[" + msg + "]");
			}
		}
	}
	
}
